/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.com.aptech.msh.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author trietto
 */
@Entity
@Table(name = "payingguestaccommodation")
@NamedQueries({
    @NamedQuery(name = "PayingGuestAccommodation.findAll", query = "SELECT p FROM PayingGuestAccommodation p")})
public class PayingGuestAccommodation implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "AdvertisingID")
    private Integer advertisingID;
    @Basic(optional = false)
    @Column(name = "City")
    private String city;
    @Basic(optional = false)
    @Column(name = "Location")
    private String location;
    @Basic(optional = false)
    @Column(name = "Deposit")
    private double deposit;
    @Basic(optional = false)
    @Column(name = "Rent")
    private double rent;
    @Basic(optional = false)
    @Column(name = "ContactDetails")
    private String contactDetails;
    @JoinColumn(name = "AdvertisingID", referencedColumnName = "AdvertisingID", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Advertising advertising;

    public PayingGuestAccommodation() {
    }

    public PayingGuestAccommodation(Integer advertisingID) {
        this.advertisingID = advertisingID;
    }

    public PayingGuestAccommodation(Integer advertisingID, String city, String location, double deposit, double rent, String contactDetails) {
        this.advertisingID = advertisingID;
        this.city = city;
        this.location = location;
        this.deposit = deposit;
        this.rent = rent;
        this.contactDetails = contactDetails;
    }

    public Integer getAdvertisingID() {
        return advertisingID;
    }

    public void setAdvertisingID(Integer advertisingID) {
        this.advertisingID = advertisingID;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public double getDeposit() {
        return deposit;
    }

    public void setDeposit(double deposit) {
        this.deposit = deposit;
    }

    public double getRent() {
        return rent;
    }

    public void setRent(double rent) {
        this.rent = rent;
    }

    public String getContactDetails() {
        return contactDetails;
    }

    public void setContactDetails(String contactDetails) {
        this.contactDetails = contactDetails;
    }

    public Advertising getAdvertising() {
        return advertising;
    }

    public void setAdvertising(Advertising advertising) {
        this.advertising = advertising;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (advertisingID != null ? advertisingID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PayingGuestAccommodation)) {
            return false;
        }
        PayingGuestAccommodation other = (PayingGuestAccommodation) object;
        if ((this.advertisingID == null && other.advertisingID != null) || (this.advertisingID != null && !this.advertisingID.equals(other.advertisingID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vn.com.aptech.msh.entities.PayingGuestAccommodation[advertisingID=" + advertisingID + "]";
    }

}
